/*!
 * \file base_exploitation.h
 * \author Cyril Henriot (elodiecyril.wedding@gmail.com)
 * 
 * This file contains a data type to encode and manipulate exploitations.
 */


/*! \brief Call to malloc instruction has failed
 */
#define EXPLOITATION_OPERATION_SUCCESS 0
#define EXPLOITATION_ERROR_1_MALLOC_INIT_FAILED 1


/*! \brief This struct contains exploitation qualite enumeration
 */
enum EXPLOITATION_QUALITE 
{ 
  Faible,
  Moyenne,
  Haute
};


/*! \brief This struct contains exploitation information
 */
typedef struct
{
  char nom[64];
  EXPLOITATION_QUALITE qualite;
} EXPLOITATION;

typedef EXPLOITATION* PTR_EXPLOITATION ;




/*! \brief Create a new instance of an object EXPLOITATION.
 *  \return 0 if success, otherwise an error code (type EXPLOITATION_ERROR)
 * 
 * All Fields are initiate at zero.
 */
int EXPLOITATION_Create(PTR_EXPLOITATION *PtrExploitation);


/*! \brief Destroy an instance of an object EXPLOITATION.
 *  \return 0 if success, otherwise an error code
 * 
 * PtrExploitation is set at NULL
 */
int EXPLOITATION_Destroy(PTR_EXPLOITATION *PtrExploitation);


/*! \brief Get exploitation name from an instance of EXPLOITATION.
 *  \return 0 if success, otherwise an error code
 */
int EXPLOITATION_GetNom (PTR_EXPLOITATION PtrExploitation, char nom[]);


/*! \brief Set exploitation name to an instance of EXPLOITATION.
 *  \return 0 if success, otherwise an error code
 */
int EXPLOITATION_SetNom (PTR_EXPLOITATION PtrExploitation, char nom[]);


/*! \brief Get exploitation qualite from an instance of EXPLOITATION.
 *  \return 0 if success, otherwise an error code
 */
int EXPLOITATION_GetQualité (PTR_EXPLOITATION PtrExploitation, EXPLOITATION_QUALITE *qualite);


/*! \brief Set exploitation qualite to an instance of EXPLOITATION.
 *  \return 0 if success, otherwise an error code
 */
int EXPLOITATION_SetQualite (PTR_EXPLOITATION PtrExploitation, EXPLOITATION_QUALITE *qualite);

